﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework;
using RealmMudLib.Screens.Base;
using RealmMudLib.Managers;
using RealmMudLib.GameObjects;

namespace RealmMudLib.Screens
{
    public class ConnectionAccepted: GameScreen
    {
        private SpriteFont Font { get; set; }
        private Vector2 Center { get; set; }
        private string Message { get; set; }
        private Button TestButton { get; set; }

        public ConnectionAccepted(string msg, ScreenManager manager)
            : base(manager)
        {
            Font = this.Manager.BaseGame.Content.Load<SpriteFont>("Fonts\\Arial");
            Message = msg;
            Center = new Vector2(this.Manager.BaseGame.GraphicsDevice.Viewport.Bounds.Width / 2 - (Message.Length * 4), this.Manager.BaseGame.GraphicsDevice.Viewport.Bounds.Height / 2);
            TestButton = new Button(new Vector2(Center.X - (this.Message.Length * 2), Center.Y + 40),
                this.Manager.BaseGame.Content.Load<Texture2D>("Buttons\\Blue\\blue_normal"),
                "Not Selected",
                this.Manager.BaseGame.Content.Load<Texture2D>("Buttons\\Blue\\blue_selected"),
                "Selected !!",
                this);
            this.AddGameObject(TestButton);
        }
        public override void Update(Microsoft.Xna.Framework.GameTime gameTime)
        {
            base.Update(gameTime);
            Center = new Vector2(this.Manager.BaseGame.GraphicsDevice.Viewport.Bounds.Width / 2 - (Message.Length * 4), this.Manager.BaseGame.GraphicsDevice.Viewport.Bounds.Height / 2);

        }
        public override void Draw(Microsoft.Xna.Framework.GameTime gameTime)
        {
            this.spriteBatch = new SpriteBatch(this.Manager.BaseGame.GraphicsDevice);
            this.Manager.BaseGame.GraphicsDevice.Clear(Color.Green);
            this.spriteBatch.Begin();
            this.spriteBatch.DrawString(Font, Message, Center, Color.Black);
            this.spriteBatch.End();
            base.Draw(gameTime);
        }
    }
}
